Skip to content

Features/sprint4 backend templates db injection#80

Merged
NgocAnhDo26 merged 49 commits into
mainfrom
features/sprint4-backend-templates-db-injection
May 26, 2026
Merged

Features/sprint4 backend templates db injection#80
NgocAnhDo26 merged 49 commits into
mainfrom
features/sprint4-backend-templates-db-injection

Conversation

@NgocAnhDo26
Copy link
Copy Markdown
Contributor

@NgocAnhDo26 NgocAnhDo26 commented May 26, 2026

Description

Type of change

  • New scaffolder templates: .NET, Java, PostgREST
  • Various bugfixes and enhancement for local dev setup.

Checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added evidence that prove my fix is effective or that my feature works
  • I have added unit tests for new feature
  • Existing unit tests pass locally with my changes
  • Prettier and linting checks pass (Backstage)
  • Issues linked to this Pull Request (Development section on the right)

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Backstage templates for scaffolding .NET Web API, Hasura GraphQL Engine, PostgREST API, and Spring Boot applications
    • Introduced database migration trigger support with automatic schema evolution
    • Added support for configurable database types, names, and versions in application deployments
    • Extended Docker registry authentication to support token-based credentials
  • Enhancements

    • Updated Node.js test image from v20 to v24
    • Updated PostgreSQL default version to 18.3
    • Improved Kubernetes secret and credential management workflows
    • Added Kubernetes namespace initialization and schema support
  • Tests

    • Added comprehensive test coverage for database migration pipeline
    • Updated test fixtures for new PostgreSQL version

PhuocHoan and others added 30 commits April 12, 2026 18:09
…ess and Create Spring Boot (Java) Backstage Template (#66)

Co-authored-by: Do Tan Ngoc Anh <119093159+NgocAnhDo26@users.noreply.github.com>
- Added `triggerType: db-migrate` to HeliosApp configuration for better migration handling.
- Introduced a new Kubernetes namespace manifest for better resource management.
- Updated PostgREST configuration to ensure log levels are consistently quoted.
- Modified webhook creation to specify a dedicated listener for DB migration triggers.
- Reorganized Tekton pipeline definitions to include a dedicated DB migration pipeline.
- Updated Git clone task to transform localhost URLs for in-cluster access.
- Enhanced database migration task to use Kubernetes secrets for database credentials.
- Improved PostgREST reload task to utilize dynamic secret names for better flexibility.
- Refined event listener to trigger DB migration pipelines based on specific directory changes.
- Added new trigger template for DB migration to streamline pipeline execution on relevant events.
…to-deploy-fixed' into features/sprint4-backend-templates-db-injection
nghiaz160904 and others added 19 commits April 20, 2026 20:38
…ate code in operator causing syntax error during compile. Add missing java test image for the test run
- fix(cue): truncate app name to 32 chars in migrate PipelineRun name to prevent exceeding Kubernetes 63-char resource name limit
- fix(cue): replace hardcoded 'api-db-secret' with dynamic databaseSecretRef in db-migrate TriggerTemplate
- fix(cue): correct migration-source path from 'db/migration' to 'db/migrations'
- fix(operator): derive db secret name from app.Name if not explicitly set
- fix(postgrest-template): use values.name for component name instead of 'api'
- fix(postgrest-template): add missing Backstage CI/CD and Kubernetes annotations
- fix(postgrest-template): mask JWT secret input with ui:widget password
- fix(catalog): remove hardcoded gitea repo-url from dotnet and spring-boot templates
  DatabaseSecretRef field in HeliosApp types and CRD schema
… in. change jwtSecret widget from password to secret
…-fix-templates

Fixes and improvements for .NET, Spring Boot and Postgrest templates
…ra-graphql-template

setup hasura-graphql-template
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

Caution

Review failed

Failed to post review comments

📝 Walkthrough

Walkthrough

Thêm pipeline Tekton “db-migrate” và trigger, mở rộng Operator để sinh PGRST_DB_URI và inject DATABASE_URL/DB_NAME, cập nhật schema/CRD/inputs, nâng cấp portal backend/actions/config, bổ sung template PostgREST/Hasura/.NET/Spring Boot, và thêm các script thiết lập cùng Taskfile.

Changes

Database migration flow and developer templates

Layer / File(s) Summary
Contracts and CRDs for trigger/test image/DB secret and env schemas
apps/operator/api/v1alpha1/*, apps/operator/config/crd/*, cue/definitions/{bases,components}/*, cue/definitions/tekton/schema.cue, apps/operator/internal/cue/tekton.go
Adds triggerType, testImage, databaseSecretRef; allows env.valueFrom; updates TektonInput.
Operator database secret/URI formatting, env injection, and reconciliation
apps/operator/internal/controller/database/*, tests
Generates PGRST_DB_URI, formats Postgres URI, injects DB_NAME/DATABASE_URL, centralizes dbType, computes effective DB name/port, bumps default Postgres 18.3; updates tests.
Tekton tasks/pipelines/triggers and CUE builder integration
cue/definitions/tekton/*, cue/engine/tekton_builder.cue, apps/operator/tekton/pipeline.yaml, tests, docs
Adds db-migrate pipeline, db-migrate/postgrest-reload tasks, trigger bundles and URL rewrites, manifest yq updates, default images to node:24; wires builder and tests; adds testing guide.
Portal backend actions, router improvements, and app config
apps/portal/packages/backend/*, apps/portal/plugins/helios-backend/src/service/router.ts, apps/portal/app-config.yaml
Adds kubernetes:create-secret, extends kubernetes:apply, registers actions; improves /info to iterate secret/labels; updates CORS, Gitea, ArgoCD target, catalog locations, kubectl proxy locator.
Example templates: PostgREST, Hasura, .NET, Spring Boot, and related catalog/org
apps/portal/examples/*
Introduces full Backstage templates and content for PostgREST/Hasura/.NET/Spring Boot; updates advanced example comment; tweaks NestJS description; adds org alias.
Setup scripts, Taskfile wiring, CI lint bump, and environment samples
Taskfile.yml, scripts/*, .env.example, .gitignore, apps/operator/.github/workflows/lint.yml, apps/operator/Makefile
Adds CoreDNS setup, externalizes Windows steps, credential scripts, start/test scripts, prereq checks; updates env/gitignore; bumps golangci-lint; minor dev:portal change.

Sequence Diagram(s)

sequenceDiagram
  rect rgba(66, 135, 245, 0.5)
  participant Dev as Developer
  participant Gitea as Gitea
  participant EL as Tekton EventListener
  end
  rect rgba(40, 167, 69, 0.5)
  participant Tkn as Tekton Pipelines
  participant DB as Postgres
  participant PGRST as PostgREST
  end
  Dev->>Gitea: Push commits (db/migrations/**)
  Gitea->>EL: Webhook (push)
  EL->>Tkn: Create PipelineRun (db-migrate)
  Tkn->>Tkn: Task git-clone (rewrite URL if localhost)
  Tkn->>DB: Task db-migrate (golang-migrate via PGRST_DB_URI)
  Tkn->>DB: Task postgrest-reload (NOTIFY pgrst,'reload schema')
  DB-->>PGRST: LISTEN pgrst (reload schema)
  PGRST-->>Dev: Updated API schema
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Poem

Tai thỏ rung rinh trước gió pipeline,
Git đẩy là Tekton chạy thẳng một line.
Migrate xong, pgrst nghe “ding!” rồi reload,
Operator rót URI, env vào pod.
Template nảy mầm: .NET, Spring, Hasura, REST—
Thỏ gõ “deploy!”—cỏ xanh khắp commit fest. 🐇✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch features/sprint4-backend-templates-db-injection

@NgocAnhDo26 NgocAnhDo26 merged commit 8278027 into main May 26, 2026
6 of 8 checks passed
@NgocAnhDo26 NgocAnhDo26 deleted the features/sprint4-backend-templates-db-injection branch May 26, 2026 15:13
@NgocAnhDo26 NgocAnhDo26 restored the features/sprint4-backend-templates-db-injection branch May 26, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] PostgREST Scaffolding Template Fails to Deploy and Connect to DB

6 participants